<?php
	require("includes/basic.php");
	if(!isset($_SESSION['uid']) && $userType!='O')
	{
		header("location:authorise.php");
	}
?>

<HTML>
	<HEAD>
		
		<TITLE> :: <?php echo $appName?> :: </TITLE>
		<link rel='stylesheet' type='text/css' href='style/inner.css'>
		<link rel='stylesheet' type='text/css' href='style/admin.css'>
		<script type='text/javascript' src='js/inner.js'></script>
	</HEAD>

	<body> 
		<?php $pageName="Administration View"; ?>
		<?php require("includes/header.php"); ?>
<?php 
$ven=$_REQUEST['open'];

$vendetails=mysql_query("SELECT * FROM vendor_master WHERE vendor_id=$ven");

while($row=mysql_fetch_array($vendetails))
{

	$vendor=$row['vendor'];
$vendor_desc=$row['vendor_desc'];
$uname=$row['user_name'];
$pass=base64_decode($row['password']);
//$type=$row['client_type'];

$created=$row['vendor_created_on'];
$record=$row['record_status'];


?>
		
<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td id='screenH'>
		<div class='pathbar'><a href='index.php'>Admin</a> -> <a href="view-vendors.php">Vendors</a> -> <?php echo $vendor;?></div>
		<div class='screenTitle'>
			<table width='100%' cellspacing='0'>
				<tr>
					<td>
						<?php echo "Vendor Details";?>
					</td>		
				</tr>
			</table>
		</div>
</table>	
		
       
		
		
        
<?php	


//extract($row);

?>


	<center>
<table>
<tr><td style="height:10px;">&nbsp;</td></tr>
</table>

	<table border="0" width="90%" style="border:1px solid #E0DFE3;" cellspacing="0" >

	
	
<tr><td colspan="2" align="left" style="border-bottom:1px solid #E0DFE3;padding:5px;font-weight:bold;font-size:13px;background-color:#E0DFE3;">Vendor Details</td></tr>


<tr>
<td colspan="2" style="border-bottom:1px solid #E0DFE3;height:60px;padding-left:10px;">

<?php
	$logo=mysql_query("select vendor_id, name from vendor_logo where vendor_id=$ven");
	if(mysql_num_rows($logo)>0)
		{
			echo "<img src='getlogo.php?vid=$ven'>";
		}
		else
		{
			echo "No logo added";
		}
?>

</td>
</tr>

<tr >
	<td class="open">Vendor</td>
    <td class="open_data"><?php echo $vendor; ?></td>
</tr>
<tr class=''>
	<td class="open">Vendor Description</td>
    <td class="open_data"><?php echo $vendor_desc; ?></td>
</tr>

<tr >
	<td class="open">User Name</td>
    <td class="open_data"><?php echo $uname; ?></td>
</tr>

<tr>
	<td class="open">Password</td>
    <td class="open_data"><?php echo $pass; ?></td>
</tr>
<tr>
	<td class="open">Record Status</td>
    <td class="open_data">
	<?php
	if($record=='Y')
	{
	echo 'Yes';
	}
	else
	{
		echo 'No';
	}
	?>
	</td>
</tr>
<?php 
$vcont=mysql_query("SELECT * FROM user_master WHERE vendor_id=$ven");
$vcont_ro=mysql_num_rows($vcont);

$ro=mysql_fetch_array($vcont);
$fname=$ro['first_name'];
$lname=$ro['last_name'];
$mobile=$ro['mobile'];
$user_name=$ro['user_name'];
$pass=base64_decode($ro['user_password']);
$created=$ro['user_created_on'];
$re=$ro['record_status'];


?>
<tr >
	<td class="open">No. of Contacts</td>
    <td class="open_data"><?php echo $vcont_ro; ?></td>
</tr>

<tr >
	<td class="open">Contact First Name</td>
    <td class="open_data"><?php echo $fname; ?></td>
</tr>

<tr>
	<td class="open">Contact Last Name</td>
    <td class="open_data"><?php echo $lname; ?></td>
</tr>

<tr >
	<td class="open">Mobile</td>
    <td class="open_data"><?php echo $mobile; ?></td>
</tr>

<tr>
	<td class="open">User Name</td>
    <td class="open_data"><?php echo $user_name; ?></td>
</tr>

<tr >
	<td class="open">Password</td>
    <td class="open_data"><?php echo $pass; ?></td>
</tr>

<tr>
	<td class="open">Contact created on</td>
    <td class="open_data"><?php echo $created; ?></td>
</tr>

<tr >
	<td class="open">Contact Record Status</td>
    <td class="open_data"><?php 
		if($re=='Y')
		{
			echo 'Yes';
		}
		else
	{
			echo 'No';
	}
	?></td>
</tr>
<?php 

}
?>
	</table>
 
	</center>
	
		<?php require("includes/footer.php"); ?>
	</BODY>
</HTML>
